package ua.openmedis.domain;

// Generated Aug 22, 2011 4:58:43 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Province generated by hbm2java
 */
@Entity
@Table(name = "province", catalog = "openmedis_demo")
public class Province implements java.io.Serializable {

	private Integer provinceId;
	private Countries countries;
	private String provinceName;
	private Set<Districts> districtses = new HashSet<Districts>(0);

	public Province() {
	}

	public Province(Countries countries, String provinceName) {
		this.countries = countries;
		this.provinceName = provinceName;
	}

	public Province(Countries countries, String provinceName,
			Set<Districts> districtses) {
		this.countries = countries;
		this.provinceName = provinceName;
		this.districtses = districtses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ProvinceID", unique = true, nullable = false)
	public Integer getProvinceId() {
		return this.provinceId;
	}

	public void setProvinceId(Integer provinceId) {
		this.provinceId = provinceId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CountryID", nullable = false)
	public Countries getCountries() {
		return this.countries;
	}

	public void setCountries(Countries countries) {
		this.countries = countries;
	}

	@Column(name = "ProvinceName", nullable = false, length = 30)
	public String getProvinceName() {
		return this.provinceName;
	}

	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "province")
	public Set<Districts> getDistrictses() {
		return this.districtses;
	}

	public void setDistrictses(Set<Districts> districtses) {
		this.districtses = districtses;
	}

}
